import Request from "./request";
/**
 * 分类
 * @param {*} data
 * @returns
 */
export const getCategory = (data) =>
  Request({
    url: "/api/home/categories",
    data,
    method: "get",
  });

export const getMsg = (data) =>
  Request({
    url: "/api/notice/list",
    data,
    method: "get",
  });

export const getSwiper = (data) =>
  Request({
    url: "/api/home/banners",
    data,
    method: "get",
  });

export const getProducts = (data) =>
  Request({
    url: "/api/home/products",
    data,
    method: "get",
  });

export const getProduct = (data) => {
  return Request({
    url: "/api/home/productDetails",
    data,
    method: "get",
  });
};

export const getUserInfo = (data) =>
  Request({
    url: "/api/user/my",
    data,
    method: "get",
  });

export const getOrders = (data) =>
  Request({
    url: "/api/home/orderAndSchedule",
    data,
    method: "get",
  });
/**
 * 支付订单
 * @param {*} data
 * @returns
 */
export const payOrder = (data) =>
  Request({
    url: "/api/home/payOrder",
    data,
    method: "get",
  });

export const payOrders = (data) =>
  Request({
    url: "/api/home/payOrders",
    data,
    method: "get",
  });

export const orderDetail = (data) =>
  Request({
    url: "/api/home/queryById",
    data,
    method: "get",
  });
/**
 * 用户信息
 * @param {*} data
 * @returns
 */
export const transferRecord = (data) =>
  Request({
    url: "/api/user/transferRecord",
    data,
    method: "get",
  });
